package com.sheet.gateway;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created with IntelliJ IDEA.
 * Description
 *
 * @Author IronSheet
 * @Date 2022/3/3 2:08
 */
@Configuration
public class GatewayConfig {

    // 配置路由规则
    @Bean
    public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
        return builder.routes()
                .route(r -> r.path("/gitee")
                .uri("http://gitee.com"))
                .build();
    }
}
